SetAxisGearInPos

从同步点开始命令从轴和主轴位置之间的齿轮比率。

注意:使用 SetGearInPos() 前主轴必须在恒定速度的移动状态。

运作方式:

首先,从轴以 MoveAxisContinuousAbsolute 移动以正确的时间及速度到达 SlaveSyncPositionVelocity, Acceleration Deceleration 输入即为此 MoveAxisContinuousAbsolute 移动所设,移动中的 StartSync 输出为 TRUE,一旦此运动完成,InSync 输出即为 TRUE。

GearInPos 设定档:

语法

KsCommandStatus SetAxisGearInPos(
     int Master,
     int Slave,
     BOOL Permanent,
     double Ratio,
     McSource MasterValueSource,
     double MasterSyncPosition,
     double SlaveSyncPosition,
     McSyncMode SyncMode,
     double MasterStartDistance,
     double Velocity,
     double Acceleration,
     double Deceleration,
     double Jerk,
     McBufferMode BufferMode
);

参数

Master [in]:主轴索引。索引以零为起点;别名将影响此参数。

Slave [in]:从轴索引。索引以零为起点;别名将影响此参数。从轴之最大数量为 32 轴。

Permanent [in]:决定马达停用后是否保留齿轮状态。

TRUE:马达停用但保留齿轮状态,例如当主轴启用时从轴也会跟著启用,而当主轴发生错误从轴也会发生错误。

FALSE:马达停用后不会保留齿轮状态。

Ratio [in]:齿轮比例。例如若比例为 3:2,从属装置移动三个单位而主装置移动两个单位。

MasterValueSource [in]:定义同步的来源。请见 McSource 类型。

MasterSyncPosition [in]:从轴与主轴同步时主轴的位置。

SlaveSyncPosition [in]:从轴与主轴同步时从轴的位置。

SyncMode [in]:决定同步的方式。请见 McSyncMode 类型。

MasterStartDistance [in]:主轴移动至与从轴同步的距离(当从轴开始进入同步时)。

Velocity [in]:同步阶段的最大速度。

Acceleration [in]:同步阶段的最大加速度。

Deceleration [in]:同步阶段的最大减速度。

Jerk [in]:同步阶段的最大加加速度。

BufferMode [in]:定义如何融合两功能的速度,请见 McBufferMode 类型。

回传值

返回 KsCommandStatus 结构。

备注

范例

KsCommandStatus AssignGearSlave(INT Master, INT Slave, DOUBLE MasterPosition, DOUBLE SlavePosition) {
   KsCommandStatus gear = WaitForCommand(10, FALSE, SetAxisGearInPos(Master, Slave,
      False, //Parameter.Permanent
      1, //Gear ratio
      mcSetValue, /*Master Value Source. Value of the master position used.
                    Cam be the target position (commanded value and set value are identical)
                    or the actual position.*/
      MasterPosition, //The master's position where the slave is in sync with the master.
      SlavePosition, //The slave's position where the slave is in sync with the master.
      mcCatchUp, /*Defines the way to synchronize 
                   (such as "mcShortest," "mcCatchUp," "mcSlowDown"). Vendor-specific.*/
      0, //This will be calculated automatically if not provided.
      3600,
      36000,
      36000,
      3600000,
      mcAborting)
   );
   return gear;
}

使用需求

  RT Win32
最低支援版本 4.0 4.0
标头档 ksmotion.h ksmotion.h
程式库 KsApi_Rtss.lib KsApi.lib

参见

PowerAxis

ReleaseAxis

SetAxisGear

StopAxis